package com.ponhu.ea2.goodsCenter.provider.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ponhu.ea2.entity.Material;
import com.ponhu.ea2.query.MaterialInfoQuery;
import com.ponhu.ea2.vo.PhMaterialVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zhaokai
 * @Entity generator.domain.Material
 */
public interface MaterialMapper extends BaseMapper<Material> {

    /**
     * 根据物料编码获取物料信息
     */
    PhMaterialVo getMaterialVoByCode(String materialCode);

    PhMaterialVo getMaterialVoById(String materialId);

    List<PhMaterialVo> getMaterialVoByIds(List<Long> materialIds);

    IPage<PhMaterialVo> queryPhMaterialInfo(Page<PhMaterialVo> page,
                                            @Param("materialInfoQuery") MaterialInfoQuery materialInfoQuery);

    PhMaterialVo getMaterialVoByModelId(Integer modelId);

    List<Material> getMaterialBySeriesOrModel(@Param("seriesId") Long seriesId,
                                              @Param("seriesName") String seriesName,
                                              @Param("modelId") Long modelId,
                                              @Param("modelName") String modelName);

}




